<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue2.6.12.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="inps">
		{{inps}}
        <button @click="add">添加</button>
		<div>
			<ul>
				<li v-for="(item,index) in todolists">{{item}} <button type="button" @click="del(index)">删除</button></li>
			</ul>
		</div>
        <div>
            <ul>
                <li v-for=""></li>
            </ul>
        </div>
    </div>
</body>
    <script>
        var vm=new Vue({
            el:"#app",
			data:{
				"inps":"",
				"todolists":[],
			},
			methods:{
				add(){
					this.todolists.push(this.inps);
				},
				del(index){
					this.todolists.splice(index,1);
				},
			}
        });
    </script>
</html>